﻿/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

using System;

namespace Gk3dEngine
{
    public class TransformComponent : Component
    {
        private Vector3 _position;
        private Quaternion _orientation;
        private Vector3 _scale;

        public TransformComponent()
        {
            _id = InternalCall.createTransformComponent();
        }

        public TransformComponent(int id)
        {
            _id = id;
            InternalCall.OnCreateTransformComponent(_id);
        }

        public void setPosition(float x, float y, float z)
        {
            _position = new Vector3(x, y, z);
            InternalCall.setPosition(_id, x, y, z);
        }

        public Vector3 getPosition()
        {
            return _position;
        }

        public void setOrientation(Quaternion orient)
        {
            _orientation = orient;
            InternalCall.setOrientation(_id, orient.W, orient.X, orient.Y, orient.Z);
        }

        public Quaternion getOrientation()
        {
            return _orientation;
        }

        public void setScale(Vector3 scale)
        {
            _scale = scale;
            InternalCall.setScale(_id, scale.X, scale.Y, scale.Z);
        }

        public Vector3 getScale()
        {
            return _scale;
        }

    }
}
